﻿<%@ Page Language="C#" MasterPageFile="~/Admin/AdminMaster.master" AutoEventWireup="true" CodeBehind="PostNews.aspx.cs" Inherits="TheHeGeoCommercial.Admin.PostNews" %>

<%@ Register Assembly="DevExpress.Web.v14.1, Version=14.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.ASPxHtmlEditor.v14.1, Version=14.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxHtmlEditor" TagPrefix="dx" %>

<%@ Register Src="~/Admin/UcAddProduct.ascx" TagPrefix="uc1" TagName="UcAddProduct" %>
<%@ Register TagPrefix="dx" Namespace="DevExpress.Web.ASPxGridView" Assembly="DevExpress.Web.v14.1, Version=14.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>

<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxSpellChecker.v14.1, Version=14.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxSpellChecker" tagprefix="dx" %>
<%@ Register TagPrefix="dx" Namespace="DevExpress.Web.ASPxHeadline" Assembly="DevExpress.Web.v14.1, Version=14.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <script type="text/javascript">
        function grvData_CustomButtonClick(s, e) {

            if (e.buttonID == 'btnDelete') {
                if (confirm("Ba&#803;n muô&#769;n xo&#769;a sa&#777;n phâ&#777;m na&#768;y?")) {

                    e.processOnServer = true;
                } else {
                    e.processOnServer = false;
                }

            }
            else {
                e.processOnServer = true;
            }
        }

     
 </script>
    &nbsp;&nbsp;&nbsp;
    <div>
    <dx:ASPxHeadline ID="ASPxHeadline4" ClientInstanceName="ASPxHeadline1" HeaderText="Thông tin Tin tức" runat="server"></dx:ASPxHeadline>  
</div>
    <div>
        <dx:ASPxGridView ID="grvNews" runat="server" ClientInstanceName="grvNews" style="margin-bottom:15px;" AutoGenerateColumns="False"  width="100%" KeyFieldName="id" OnCustomButtonCallback="grvNews_CustomButtonCallback" >
            <ClientSideEvents CustomButtonClick="grvData_CustomButtonClick" />
        <Columns>
         <dx:GridViewCommandColumn Name="cmdBtn" ShowInCustomizationForm="False" VisibleIndex="0" ButtonType="Link" Caption="" Width="100px">
            <CustomButtons>
                <dx:GridViewCommandColumnCustomButton ID="btnNew" Text="Add" Visibility="AllDataRows">
                </dx:GridViewCommandColumnCustomButton>
                <dx:GridViewCommandColumnCustomButton ID="btnEdit" Text="Edit" Visibility="AllDataRows">
                </dx:GridViewCommandColumnCustomButton>
                    <dx:GridViewCommandColumnCustomButton ID="btnDelete" Text="Delete" Visibility="AllDataRows">
                </dx:GridViewCommandColumnCustomButton>
        </CustomButtons>
            <HeaderStyle  HorizontalAlign="Center" VerticalAlign="Middle" />
        </dx:GridViewCommandColumn>       
        <dx:GridViewDataTextColumn Caption="Id" FieldName="id" Width="150px" VisibleIndex="0" Visible="False" >
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <CellStyle HorizontalAlign="Center" VerticalAlign="Middle"> 
            </CellStyle>
        </dx:GridViewDataTextColumn> 
        <dx:GridViewDataTextColumn Caption="Title" FieldName="NewsTitle" Width="250px" ReadOnly="True" VisibleIndex="1">
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <CellStyle HorizontalAlign="Center" VerticalAlign="Middle"> 
            </CellStyle>
        </dx:GridViewDataTextColumn>

        <dx:GridViewDataTextColumn Caption="To&#769;m t&#259;&#769;t" FieldName="ShortView" Width="550px" ReadOnly="True" VisibleIndex="2">
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <CellStyle HorizontalAlign="Left" VerticalAlign="Middle">
            </CellStyle>
        </dx:GridViewDataTextColumn>  
            
         <dx:GridViewDataTextColumn Caption="A&#777;nh &#273;a&#803;i diê&#803;n" FieldName="AvatarPath" Width="550px" ReadOnly="True" VisibleIndex="3">
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <CellStyle HorizontalAlign="Left" VerticalAlign="Middle">
            </CellStyle>
        </dx:GridViewDataTextColumn>         
    </Columns>
        <SettingsBehavior ConfirmDelete="True" AutoFilterRowInputDelay="100" />
    <SettingsPager PageSize="15">
    </SettingsPager>
    <Settings ShowFilterRow="True" ShowFilterRowMenu="True" /><SettingsText ConfirmDelete="B&#7841;n có mu&#7889;n xóa dòng d&#7919; li&#7879;u này ?" />
    <Settings ShowFilterRow="True" ShowFilterRowMenu="True"   HorizontalScrollBarMode="Auto"/>
    </dx:ASPxGridView> 
    </div>
    <div>
        <table><tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Tiêu &#273;ê&#768;:" Width="100px"></asp:Label></td>
                <td>
                    <dx:ASPxMemo ID="txtTitle" runat="server" Height="71px" Width="790px" style="margin-bottom:15px;" ></dx:ASPxMemo>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Short View:"></asp:Label>
                </td>
                <td>
                    <dx:ASPxMemo ID="txtShortView" runat="server" Height="71px" Width="790px" style="margin-bottom:15px;" ></dx:ASPxMemo>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="A&#777;nh &#273;a&#803;i diê&#803;n:" Width="100px"></asp:Label>
                </td>
                <td>
                    <dx:ASPxUploadControl ID="uploadAvatar" style="margin-bottom:15px;" runat="server" UploadMode="Auto" Width="790px"  ShowUploadButton="True" AddUploadButtonsHorizontalPosition="Left" OnFileUploadComplete="uploadAvatar_FileUploadComplete"></dx:ASPxUploadControl>
                </td>
            </tr>
        </table>
    </div>
    <div>
         <dx:ASPxHtmlEditor ID="htmlNewsEdit" runat="server" Width="100%"  >
         <SettingsImageUpload UploadImageFolder="~/UploadImages/">
            <ValidationSettings AllowedFileExtensions=".jpe,.jpeg,.jpg,.gif,.png" MaxFileSize="5000000">
            </ValidationSettings>
        </SettingsImageUpload>                       
    </dx:ASPxHtmlEditor>
    </div>
   <div>
       <asp:Button ID="btnSave" runat="server" Text="Save" style="margin-top:10px;Height:25px; Width:70px" OnClick="btnSave_Click"/>
       <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
   </div>
</asp:Content>


